package com.start.avue.configs;

import com.start.avue.calculate.*;

import java.util.HashMap;
import java.util.Map;

/**
 * 计算映射配置
 */
public class StartCalculateConfig {
    private static final Map<String, Class<? extends StartCalculate>> DEFAULT_CALCULATE_MAP = new HashMap<>();

    static {
        DEFAULT_CALCULATE_MAP.put(StartAvgCalculate.CALCULATE_TYPE_AVG, StartAvgCalculate.class);
        DEFAULT_CALCULATE_MAP.put(StartMaxCalculate.CALCULATE_TYPE_MAX, StartMaxCalculate.class);
        DEFAULT_CALCULATE_MAP.put(StartMinCalculate.CALCULATE_TYPE_MIN, StartMinCalculate.class);
        DEFAULT_CALCULATE_MAP.put(StartSumCalculate.CALCULATE_TYPE_SUM, StartSumCalculate.class);
    }

    public static Map<String, Class<? extends StartCalculate>> getDefaultCalculateMap() {
        Map<String, Class<? extends StartCalculate>> result = new HashMap<>();
        result.putAll(DEFAULT_CALCULATE_MAP);
        return result;
    }

}
